<%@ taglib uri="/WEB-INF/tlds/struts-tiles.tld" prefix="tiles" %>
<%@ taglib uri="/tags/struts-bean" prefix="bean" %>
<%@ taglib uri="/tags/struts-html" prefix="html" %>
<%@ taglib uri="/tags/struts-logic" prefix="logic" %>
<script>
function fnUpload(){
	var filePath = document.getElementById("bulk_questions").value.toUpperCase();	
	if((filePath.length - filePath.indexOf(".XLS"))==4 ){		
		window.document.questionForm.action = '/uploadQuestionFile.do';
		window.document.questionForm.submit();
	}
	else{
		alert("Only Micorsoft Excel file can be uploaded");
		return;
	}
}
</script>
<html:form action="/uploadQuestionFile" enctype="multipart/form-data">
<table width="550" border="0" align="center" cellspacing="0" cellpadding="0">
	<tr>
		<td>&nbsp;</td>
	</tr>
	<tr>
		<td class="heading1">Question File Upload</td>
	</tr>
	<tr>
		<td valign="top">&nbsp;</td>
	</tr>
	<tr>
		<td id="msg"><jsp:include page="showErrorMessage.jsp"/></td>
	</tr>
	<tr>
		<td>
			<table width="100%" border="0" align="center" cellpadding="0" cellspacing="0">
				<tr>
					<td align="center" width="32%" valign="top" class="inputtext">File Name</td>
					<td align="left" valign="middle"><html:file property="bulk_questions" styleId ="bulk_questions"/></td>
				</tr>
				<tr>
					<td height="25" colspan="4" valign="top"  >&nbsp;</td>
				</tr>
				<tr>
					<td colspan="4" valign="top"  bgcolor="#CCCCCC"><img src="images/zero.gif" width="1" height="1" /></td>
				</tr>
				<tr>
					<td height="25" colspan="4" align="center" valign="top" >&nbsp;</td>
				</tr>
				<tr>
					<td height="25" colspan="4" align="center" valign="top">
						<input type="button" class="imageButton" value="Upload" onClick="javascript:fnUpload()">
					</td>
				</tr>
				<tr>
					<td height="25" colspan="4" align="center" valign="top" >&nbsp;</td>
				</tr>
			</table>
		</td>
	</tr>
</table>
</html:form>
